<?php 
/**
 * @author Eugenio Fage
 * http://eugeniofage.wordpress.com/
 * http://code.google.com/p/monky/
 * 
 */


App::import('Sanitize');

$_classComment='comment-body';
if($comment['Comment']['karma']>Configure::read('Monky.Karma.comment_best_karma')) $_classComment.=' best-comment-body';
if($comment['Comment']['karma']>Configure::read('Monky.Karma.comment_hidden_karma')) $_classComment.=' bad-comment-body';


?>
<div id="comment-<?=$comment['Comment']['id']; ?>">
  <div class="<?=$_classComment ?>">
	<div style="float:right; margin:0 0 5px 5px">
	  <?=$this->Html->link('#'.($i+$offset),array('controller'=>'comments','action'=>'redirectToLinkComment',$comment['Comment']['id'])) ?>
	</div>
    <?=$this->Text->autoLinkUrls(nl2br(Sanitize::html(wordwrap($comment['Comment']['content'],100,' ',true))),array('rel'=>'external nofollow')); ?>
  </div>
  <div class="comment-meta">
    <div class="comment-karma">
	  <? printf(__("karma %s, votes %s",true),$comment['Comment']['karma'],$comment['Comment']['votes']) ?>
	  <? if($comment['Comment']['isVotable']){ ?>
	    <a class="votePosComment" title="<?=__('informativo, buena opinion, buen humor...',true) ?>"></a> 
	    <a class="voteNegComment" title="<?=__('insulto, spa, troll, racista...',true) ?>"></a>
	  <?php } ?>      
    </div>
    <div class="comment-author">
      <? printf(__("sended %s, by %s",true),$this->Time->timeAgoInWords($comment['Comment']['created']),$this->Html->link($comment['User']['username'],array('controller'=>'users','action'=>'view',$comment['User']['id']))) ?>
    </div>
  </div>
</div>